package gui.models;

import java.util.ArrayList;
import java.util.List;
import java.util.Observable;

import common.types.FictionalCharacter;

public class ConfigurationModel extends Observable {
	
	private static final int UNDEFINED_INT = -1;
	private List<FictionalCharacter> characters = new ArrayList<FictionalCharacter>();
	private FictionalCharacter selectedCharacter;
	private String searchName;
	private int searchResultsSize = UNDEFINED_INT;
	
	public void createNewCharacter() {
		selectedCharacter = new FictionalCharacter();
	}
	
	public void setCharacters(List<FictionalCharacter> list) {
		this.characters = list;
		setChanged();
	}
	
	public List<FictionalCharacter> getCharacters() {
		return characters;
	}
	
	public void setSearchResultsSize(int size) {
		this.searchResultsSize = size;
		setChanged();
	}
	
	public int getSearchResultsSize() {
		return searchResultsSize;
	}

	public FictionalCharacter getSelectedCharacter() {
		return selectedCharacter;
	}

	public void setSelectedCharacter(FictionalCharacter selectedCharacter) {
		this.selectedCharacter = selectedCharacter;
		setChanged();
	}

	public void setSearchName(String searchName) {
		this.searchName = searchName;
	}

	public String getSearchName() {
		return searchName;
	}

}
